*------------------------------------------------------------------------------*
				*** FIGURE S8. TRENDS IN PM10 BY YEAR ***
*------------------------------------------------------------------------------*

use "${rawdata}pollution/pollution_UBA_d_19902019.dta"

*------------------------------------------------------------------------------*

*Drop years when PM10 was not measured
keep if year >= 2000 & year <= 2018

*------------------------------------------------------------------------------*

*Generate PM10 in 10s of micrograms
gen PM10_10ug = PM10_ug / 10

*------------------------------------------------------------------------------*

***Split sample based on quartiles of average pollution
egen avPM10_10ug_w = mean(PM10_10ug), by(station)

xtile qrt = avPM10_10ug_w, nq(4)

egen avPM10_q1 = mean(PM10_10ug), by(year), if qrt == 1
egen avPM10_q23 = mean(PM10_10ug), by(year), if qrt == 2 | qrt == 3
egen avPM10_q4 = mean(PM10_10ug), by(year), if qrt == 4

*------------------------------------------------------------------------------*

collapse avPM10_q1 avPM10_q23 avPM10_q4, by(year)

*------------------------------------------------------------------------------*

***Line graph
twoway (line avPM10_q1 year) || (line avPM10_q23 year) || (line avPM10_q4 year), ///
		graphregion(color(white)) legend(label(1 "Bottom 25%") label(2 "Middle 50%") label(3 "Top 25%") rows(1)) ///
		xtitle("Year") ytitle("PM10 (10{&mu}g/m{sup:3})")
		
graph export "${outputs}figure_S8.png", replace

*------------------------------------------------------------------------------*

clear

exit
